<admintpl file="header" />
</head>
<body>
	<div class="wrap">
		<ul class="nav nav-tabs">
			<li ><a href="{:U('classify/index')}">分类列表</a></li>
			<li><a href="{:U('classify/add')}">新增分类</a></li>
			<li class="active"><a>编辑分类</a></li>
		</ul>
		<form method="post" class="form-horizontal js-ajax-form" action="{:U('classify/edit_post')}">
			<fieldset>
				<div class="control-group">
					<label class="control-label">分类名称</label>
					<div class="controls">
						<input type="text" name="name" value="{$name}"><span class="form-required">*</span>
						<input type="hidden" name="id" value="{$id}">

					</div>
				</div>
				<div class="control-group">
					<label class="control-label">上级分类</label>
					<div class="controls">
						<select name="pid" ><span class="form-required">*</span>
							<option name="pid" value="0" >作为一级分类</option>
							<foreach name="classifies" item="vo">
								<option name="pid" value="{$vo.id}" {$vo.cookselected}>{$vo.name}</option>
							</foreach>
						</select>
					</div>
				</div>
				<div class="control-group">
					<label class="control-label">分类图</label>
					<input type="hidden" name="image" id="thumb" value="{$image}">
					<a href="javascript:upload_one_image('图片上传','#thumb');" style="padding-left:20px">
						<if condition="empty($image)">
							<img src="__TMPL__Public/assets/images/default-thumbnail.png" id="thumb-preview" width="135" style="cursor: hand"/>
							<else />
							<img src="{:sp_get_image_preview_url($image)}" id="thumb-preview" width="135" style="cursor: hand"/>
						</if>
					</a>
					<input type="button" class="btn btn-small" onclick="$('#thumb-preview').attr('src','__TMPL__Public/assets/images/default-thumbnail.png');$('#thumb').val('');return false;" value="取消图片">

				</div>
			</fieldset>
			<div class="form-actions">
				<button type="submit" class="btn btn-primary js-ajax-submit">{:L('SAVE')}</button>
				<a class="btn" href="javascript:history.back(-1);">{:L('BACK')}</a>
			</div>
		</form>
	</div>
	<script src="__PUBLIC__/js/common.js"></script>
</body>
</html>